add serverless project import#961
Conversation
Co-authored-by: Dmitry Onishchenko <8962171+dimuon@users.noreply.github.com>
3f37d7f to
829d086
Compare
| ResourceName: resourceName, | ||
| ImportState: true, | ||
| ImportStateVerify: true, | ||
| // TODO(gr): reenable after checking the order of product_types is not important |
There was a problem hiding this comment.
This fails with product types because they are not in a stable order. There is already handling for order insensitive equality in
@norrietaylor since you implemented this originally, thoughts on how to resolve this? Why is ListSemanticEquals separate from Equal? Can we sort the product lines as returned from the api or is the order significant elsewhere?
There was a problem hiding this comment.
Does using their plancheck interface take semantic equality into account (IIUC it should since it's just asserting there's an empty plan)
ImportPlanChecks: resource.ImportPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectEmptyPlan(),
},
},
Why is ListSemanticEquals separate from Equal?
That's what the Terraform framework wants. Semantically equal values will be substituted by the prior value during plan/apply and so won't trigger errors due to inconsistent state.
Can we sort the product lines as returned from the api or is the order significant elsewhere?
We can, but we're then adding a bunch of code to workaround a test framework limitation which isn't ideal. I'd be surprised if we can't implement adequate validation via ImportPlanChecks
There was a problem hiding this comment.
Sorry for the late reply, yep an empty plan should be the equivalent of what ImportStateVerify accomplishes.
Co-authored-by: Toby Brain <toby.brain@elastic.co>
Description
enable serverless project import with
terraform importRelated Issues
closes #918
Motivation and Context
Allows management of existing projects.
How Has This Been Tested?
dev_overridesto import observability and elasticsearch projects manuallyTypes of Changes
Readiness Checklist
Assisted by Cursor AI.